package com.ftg.learn.chapter13.lambda;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.function.*;

/**
 * @author kangjx
 * @createTime 2022/8/9
 */
public class Operation {

    public void t() {
//        List<Integer> list = Arrays.asList(23, 1, 3, 4, 6);
//        list.forEach(a -> System.out.println(a+3));
        Operation o = new Operation();
        int he = o.yunsuan(2,3,(x,y) -> x + y);
        int ji = o.yunsuan(2,3,(x,y)->x^y);
    }

    public int yunsuan(Integer x,Integer y,BiFunction<Integer,Integer,Integer> a){
       return a.apply(x,y);
    }


    public int jiafa(int x, int y) {
        return x + y;
    }

    public int jianfa(int x, int y) {
        return x - y;
    }

    public int chengfa(int x, int y) {
        return x * y;
    }


    public int chufa(int x, int y) {
        return x / y;
    }


}
